﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.IO;
using System.Data.SqlServerCe;

namespace ProjetoFase2
{
    class Technician
    {
        private string id;
        private string password;
        private string supervisor;
        private string district;
        private int category;
        private string name;

        public string Password
        {
            get { return password; }
            set { password = value; }
        }

        public string District
        {
            get { return district; }
            set { district = value; }
        }

        public int Category
        {
            get { return category; }
            set { category = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Supervisor
        {
            get { return supervisor; }
            set { supervisor = value; }
        }

        public string Id
        {
            get { return id; }
            set { id = value; }
        }

        public Technician(DataTableReader dtReader)
        {
            id = dtReader.GetString(0);
            password = dtReader.GetString(1);
            name = dtReader.GetString(2);
            district = dtReader.GetString(3);
            category = dtReader.GetInt32(4);
            if (!dtReader.IsDBNull(5))
            {
                supervisor = dtReader.GetString(5);
            }
        }

        public Technician(SqlCeDataReader dtReader)
        {
            id = dtReader.GetString(0);
            password = dtReader.GetString(1);
            name = dtReader.GetString(2);
            district = dtReader.GetString(3);
            category = dtReader.GetInt32(4);
            if (!dtReader.IsDBNull(5))
            {
                supervisor = dtReader.GetString(5);
            }
        }

    }
}
